<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a="http://richfaces.org/a4j"
	template="/processes/processes-frame.xhtml">

	<ui:param name="pageTitle"
		value="#{messages['page.processes.index.title']}" />

	<ui:define name="subheader">#{messages['page.processes.index.subheader']}</ui:define>

	<ui:define name="main">
		<h:form>
			<rich:extendedDataTable style="width: 100%;"
				value="#{processBean.getAll()}" var="process" rows="20" id="table"
				rowClasses="odd-row, even-row"
				onRowMouseOver="this.className='extdt-row-selected'"
				onRowMouseOut="this.className=''" styleClass="stable">

				<rich:column width="25%">
					<f:facet name="header">
						<h:outputText value="#{messages['process.endActivityName']}" />
					</f:facet>
					<h:outputText value="#{process.endActivityName}"
						converter="taskNameConverter" />
				</rich:column>

				<rich:column width="20%">
					<f:facet name="header">
						<h:outputText value="#{messages['process.endTime']}" />
					</f:facet>
					<h:outputText value="#{process.endTime}" />
				</rich:column>

				<rich:column width="20%">
					<f:facet name="header">
						<h:outputText value="#{messages['process.startTime']}" />
					</f:facet>
					<h:outputText value="#{process.startTime}" />
				</rich:column>

				<rich:column width="15%">
					<f:facet name="header">
						<h:outputText value="#{messages['process.state']}" />
					</f:facet>
					<h:outputText value="#{process.state}" />
				</rich:column>

				<rich:column width="20%">
					<f:facet name="header">
						<h:outputText value="#{messages['process.processId']}" />
					</f:facet>
					<h:outputText value="#{process.processInstanceId}" />
				</rich:column>

				<a:support event="onRowClick"
					action="#{processBean.setSelectedProcess(process)}" />
				<f:facet name="footer">
					<rich:datascroller for="table" id="tableScroller" />
				</f:facet>

			</rich:extendedDataTable>
		</h:form>
	</ui:define>
</ui:composition>